<template>
	<view class="container">
		<!-- <div class="header-top">假期是出游高峰，余票有限，建议提前购买</div> -->
		<view class="shops-list">
			<block>
				<!--商品列表-->
				<view class="tui-item-box flex" style="flex-direction:column;display: flex;" hover-class="hover"
					:hover-start-time="150" >
					<image class="tui-img" :src="act.listPicUrl" mode="widthFix" />
					<div class="flex flex-col">
						<!-- <view class="tui-sub-title">{{item.name || ''}}</view> -->
						<view class="tui-sub-title">报名截止：{{act.signupTime || ''}}</view>
						<view clclass="flex justify-start align-center font-16" style="width: 682rpx;">
							<tui-divider dividerColor="#DCDCDC" width="100%" height="20"></tui-divider>
						</view>
						<view class="tui-sub-title">线下赛日期：{{act.startTime|| ''}} - {{act.endTime || ''}}</view>
						<view clclass="flex justify-start align-center font-16" style="width: 682rpx;">
							<tui-divider dividerColor="#DCDCDC" width="100%" height="20"></tui-divider>
						</view>
						<view class="bottom-container">
							<view class="ul-item">
								<view @tap="tapEvent" data-index="1" data-key="报名" class="item" hover-class="opcity" :hover-stay-time="150">
									<image class="item-img" src="/static/images/my/feedback.png"></image>
									<text class="item-name">报名</text>
								</view>
								<view @tap="selectTapEvent" data-index="2" data-key="查询报名" class="item" hover-class="opcity" :hover-stay-time="150">
									<image class="item-img" src="/static/images/my/log.png"></image>
									<text class="item-name">查询报名</text>
								</view>
								<view  data-index="2" data-key="查询报名" class="item" hover-class="opcity" :hover-stay-time="150">
								<!-- 	<image class="item-img" src="/static/images/my/log.png"></image>
									<text class="item-name">查询报名</text> -->
								</view>
								<view  data-index="2" data-key="查询报名" class="item" hover-class="opcity" :hover-stay-time="150">
								<!-- 	<image class="item-img" src="/static/images/my/log.png"></image>
									<text class="item-name">查询报名</text> -->
								</view>
							</view>
						</view>
					</div>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	const util = require("@/utils/util.js")
	export default {
		components: {},
		data() {
			return {
				id:'',
				title: '',
				act: {},
			};
		},
	
		onLoad: function(options) {
			uni.setNavigationBarTitle({
				title: options.title
			});
			console.log(options);
			this.id = options.id;
			this.title = options.title;
			this.getDataList();
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		},
		// 下拉刷新
		onPullDownRefresh: function() {
			// 显示顶部刷新图标
			uni.showNavigationBarLoading();
			// 隐藏导航栏加载框
			uni.hideNavigationBarLoading();
			// 停止下拉动作
			uni.stopPullDownRefresh();
		},
		onShareTimeline: function() {
			return {
				title: app.globalData.projectName,
				path: '/pages/index/index'
			}
		},
		onShareAppMessage: function() {
			return {
				title: app.globalData.projectName,
				path: '/pages/index/index'
			}
		},
		methods: {
			tapEvent: function(e) {
				let index = e.currentTarget.dataset.index;
				let url = '';
				if (index == 1) {
					url = '/pagesA/activities/signsubmit?id='+this.id+'&title='+ this.title
				} else if (index == 2) {
					let key = e.currentTarget.dataset.key;
					url = '/pages/index/maps/maps?key=' + key;
					// #ifdef MP-QQ
					this.tui.toast('功能开发中~');
					return;
					// #endif
				} else {
					url = '/pages/common/log/log';
				}
				uni.navigateTo({
					url: url
				});
			},
			
			selectTapEvent:function(e){
				var that = this;
				uni.navigateTo({
					url: '/pagesA/activities/selectResult?id='+that.id
				});
			},
			
			getDataList() {
				var that = this
				util.request('activities/detail', {
					id: that.id
				}).then(function(res) {
					console.log(res)
					if (res.code == 0) {
						that.act = res.data
					}
				});
			},
		}
	}
</script>
<style lang="scss">
	.container {
		position: relative;
		padding-bottom: 100rpx;
	}
	
	.top-container {
		height: 440rpx;
		position: relative;
		display: flex;
		flex-direction: column;
	}
	
	.bg-img {
		position: absolute;
		width: 100%;
		height: 440rpx;
	}
	
	.logout {
		width: 110rpx;
		height: 36rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		margin: 42rpx 0 24rpx 32rpx;
		position: relative;
		z-index: 2;
	}
	
	.logout-img {
		width: 36rpx;
		height: 36rpx;
		margin-right: 11rpx;
	}
	
	.logout-txt {
		font-size: 28rpx;
		color: #fefefe;
		line-height: 28rpx;
	}
	
	.user-wrapper {
		display: flex;
		justify-content: center;
		position: relative;
		z-index: 2;
	}
	
	.user {
		display: flex;
		flex-direction: column;
		justify-content: center;
		position: relative;
		z-index: 2;
	}
	
	.avatar-img {
		width: 160rpx;
		height: 160rpx;
		border-radius: 50%;
		align-self: center;
	}
	
	.user-info {
		display: flex;
		flex-direction: row;
		margin-top: 30rpx;
		align-items: center;
	}
	
	.user-info-mobile {
		margin-top: 30rpx;
		position: relative;
		font-size: 28rpx;
		color: #fefefe;
		line-height: 28rpx;
		align-self: center;
		padding: 0 50rpx;
	}
	
	.edit-img {
		position: absolute;
		width: 42rpx;
		height: 42rpx;
		right: 0;
		bottom: -4rpx;
	}
	
	.edit-img>image {
		width: 42rpx;
		height: 42rpx;
		padding-left: 25rpx;
	}
	
	.middle-container {
		height: 138rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		border-radius: 10rpx;
		background-color: #ffffff;
		margin: -30rpx 30rpx 26rpx 30rpx;
		box-shadow: 0 15rpx 10rpx -15rpx #efefef;
		position: relative;
		z-index: 2;
	}
	
	.middle-item {
		height: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	
	.ticket-img {
		width: 80rpx;
		height: 80rpx;
		margin-left: 65rpx;
	}
	
	.middle-tag {
		font-size: 28rpx;
		color: #333333;
		line-height: 28rpx;
		font-weight: bold;
		padding-left: 22rpx;
	}
	
	.car-img {
		width: 80rpx;
		height: 80rpx;
		margin-left: 97rpx;
	}
	
	.bottom-container {
		height: 334rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 40rpx 74rpx 40rpx 95rpx;
		// margin: 0 30rpx;
		// margin-right: 40rpx;
		background-color: #ffffff;
		border-radius: 10rpx;
		box-sizing: border-box;
		box-shadow: 0 0 10rpx #efefef;
	}
	
	.ul-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}
	
	.item {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: relative;
	}
	
	.item-img {
		width: 64rpx;
		height: 64rpx;
	}
	
	.item-name {
		padding-top: 13rpx;
		font-size: 24rpx;
		color: #666666;
		min-width: 80rpx;
		text-align: center;
	}
	
	.btn-feedback {
		background: transparent !important;
		position: absolute;
		height: 100%;
		width: 100%;
		left: 0;
		top: 0;
		border: 0;
	}
	
	.btn-feedback::after {
		border: 0;
	}
	.tui-applets__vip{
		width: 100%;
		position: fixed;
		bottom: 20px;
		/* #ifdef H5 */
		bottom: 70px;
		padding-bottom: env(safe-area-inset-bottom);
		/* #endif */
		z-index: 10;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #586c94;
	}
	.tui-applets__vip text{
		padding-left: 10rpx;
	}
	page {
		background-color: #f4f4f4;
	}

	.shops-list {
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;
		box-sizing: border-box;
		margin: 20rpx 20rpx 20rpx 20rpx;
	}

	.header-top {
		background-color: blanchedalmond;
		font-size: 28rpx;
		padding: 20rpx;
	}

	.tui-desc {
		display: flex;
		align-items: flex-end !important;
		box-sizing: border-box;
		margin-top: 5rpx;
		font-size: 24rpx;
	}

	.tui-item-box {
		border-radius: 20rpx;
		background: #fff;
		box-shadow: 0 3rpx 20rpx rgba(183, 183, 183, 0.3);
		overflow: hidden;
		padding: 0rpx;
		width: 710rpx;
	}

	.tui-img {
		width: 100%;
		height: 200rpx;
		display: block;
	}

	// .tui-title {
	// 	word-break: break-all;
	// 	overflow: hidden;
	// 	text-overflow: ellipsis;
	// 	display: -webkit-box;
	// 	-webkit-box-orient: vertical;
	// 	-webkit-line-clamp: 2;
	// 	font-size: 34rpx;
	// 	font-weight: bold;
	// 	color: #333333;
	// }

	.tui-sub-title {
		font-weight: 400;
		color: #333333;
		// font-size: 24rpx;
		word-break: break-all;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		margin: 10rpx 0rpx 10rpx 20rpx;
	}

	.tui-sale-price {
		font-weight: 600;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FF3B30;
	}
</style>